
# Unreported Absenteeism

vht_mlcb$parents_complain_q5_1

vht_ml$complain_absenteeism <- NA
vht_ml$complain_absenteeism[vht_ml$parents_complain_q5_1 == 2] <- 1
vht_ml$complain_absenteeism[vht_ml$parents_complain_q5_1 == 1] <- 0


# Norms and attitude outcomes


# vht_ml compliance ----------------------------------------------------------


#             Answer to 19.1)                       Answer to 19.2)
# complrs     1,2,3,4,5, or 6                       anything
# ind compl   0 but knew about screenings           Yes, friends and family
#             0 did not know about the screenings   Yes, friends
#             Don’t know                            Yes, family
#             Refuse to answer
# appr. nt    0 but knew about screenings           No
#                                                   Don't know 
#                                                   refuse
# never-takr  0 did not know about screenings       No
#             Don't know                            Don't know
#             Refuse to answer                      Refuse

vht_mlcb$films_q17_1
vht_mlcb$other_attend_q17_2

vht_ml$compliance[vht_ml$films_q17_1 %in% 1:6] <- 1
vht_ml$compliance[!(vht_ml$films_q17_1 %in% 1:6) & vht_ml$other_attend_q17_2 %in% 1:3] <- 2
vht_ml$compliance[vht_ml$films_q17_1 == 7 & (vht_ml$other_attend_q17_2 == 4 | is.na(vht_ml$other_attend_q17_2))] <- 3
vht_ml$compliance[vht_ml$films_q17_1 == 8 & (vht_ml$other_attend_q17_2 == 4 | is.na(vht_ml$other_attend_q17_2))] <- 4


vht_ml$compliance_label[vht_ml$compliance == 1] <- "Complier"
vht_ml$compliance_label[vht_ml$compliance == 2] <- "Indirect Complier"
vht_ml$compliance_label[vht_ml$compliance == 3] <- "Apprised Never-Taker"
vht_ml$compliance_label[vht_ml$compliance == 4] <- "Never-Taker"

# Cluster-level covariates ------------------------------------------------

# health_center_2
vht_mlcb$unit_q2_7
vht_ml$health_center_2 <- vht_ml$number_q2_7
# Converting hours to minutes
vht_ml$health_center_2[vht_ml$unit_q2_7 == 2] <- vht_ml$number_q2_7[vht_ml$unit_q2_7 == 2]*60
# Presumably if the number is 30, the unit should be minutes (in 3 cases it said hours)
vht_ml$health_center_2[vht_ml$unit_q2_7 == 2 & vht_ml$number_q2_7 == 30] <- vht_ml$number_q2_7[vht_ml$unit_q2_7 == 2 & vht_ml$number_q2_7 == 30]
# Converting days to minutes
# vht_ml$number_q2_7[vht_ml$unit_q2_7 == 3]
# Only one observation for which days was selected and the number is 45. Assuming that this was meant to be 45 minutes.

# health_center_3
vht_mlcb$unit_q2_7b
vht_ml$health_center_3 <- vht_ml$number_q2_7b
# Converting hours to minutes  
vht_ml$health_center_3[vht_ml$number_q2_7b == 2] <- vht_ml$number_q2_7b[vht_ml$number_q2_7b == 2]*60
# Converting days to minutes  (Assuming a days journey is 8 hours)
vht_ml$health_center_3[vht_ml$number_q2_7b == 3] <- vht_ml$number_q2_7b[vht_ml$number_q2_7b == 3]*8*60

# housheholds_vht
vht_mlcb$households_q2_8
vht_ml$housheholds_vht <- vht_ml$households_q2_8

# rounds_vht
vht_mlcb$visits_q2_9units
vht_ml$rounds_vht <- vht_ml$visits_q2_9number
# Converting Days to months (30 days in a month)
vht_ml$rounds_vht[vht_ml$visits_q2_9units == 1 & !is.na(vht_ml$visits_q2_9units)] <- vht_ml$visits_q2_9number[vht_ml$visits_q2_9units == 1 & !is.na(vht_ml$visits_q2_9units)]*30 
# Converting Weeks to months (4 weeks in a month)
vht_ml$rounds_vht[vht_ml$visits_q2_9units == 2 & !is.na(vht_ml$visits_q2_9units)] <- vht_ml$visits_q2_9number[vht_ml$visits_q2_9units == 2 & !is.na(vht_ml$visits_q2_9units)]*4 
# Converting Years to months (12 months in a year)
vht_ml$rounds_vht[vht_ml$visits_q2_9units == 4 & !is.na(vht_ml$visits_q2_9units)] <- vht_ml$visits_q2_9number[vht_ml$visits_q2_9units == 4 & !is.na(vht_ml$visits_q2_9units)]/12 

# doctor_rounds
vht_ml$doctor_rounds <- (vht_ml$rounds_q6_1 ==1)*1 
vht_ml$doctor_rounds[is.na(vht_ml$rounds_q6_1)] <- NA

# medical_care
vht_ml$go_to_clinic <- (vht_ml$machete_q6_2 == 1)*1
vht_ml$go_to_hospital <- (vht_ml$machete_q6_2 == 2)*1
vht_ml$go_to_vht <- (vht_ml$machete_q6_2 == 4)*1

# proportion_witch_doctor
vht_ml$proportion_witch_doctor <- 4 - vht_ml$witchdoctor_q6_4




